//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

public class demo_389 {
    public demo_389() {
    }

    public char findTheDifference(String s, String t) {
        int[] sASCII = new int[26];
        int[] tASCII = new int[26];

        for(int i = 0; i < s.length(); ++i) {
            ++sASCII[s.charAt(i) - 97];
            ++tASCII[t.charAt(i) - 97];
        }

        ++tASCII[t.charAt(t.length() - 1) - 97];

        int j;
        for(j = 0; sASCII[j] == tASCII[j]; ++j) {
        }

        return (char)(j + 97);
    }

    public char findTheDifference2(String s, String t) {
        char ans = t.charAt(t.length() - 1);

        for(int i = 0; i < s.length(); ++i) {
            ans = (char)(ans ^ s.charAt(i));
            ans = (char)(ans ^ t.charAt(i));
        }

        return ans;
    }
}
